<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{&SITE_TITLE}</title>
    <link href="__PUBLIC__/admin/css/layout.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Public/Js/jquery-1.2.6.js" ></script>

      <script type="text/javascript">
      $( function(){
          $( "select[name='sorder']" ).val("{$sorder}");
          $( "select[name='eorder']" ).val("{$eorder}");
          $( "select[name='limit']" ).val("{$limit}");
          });
var ctrl = function(name){
  this.elements = document.getElementsByName('id[]');
  this.length = this.elements.length;
}
ctrl.prototype = {
reverse:function(){
          for(i=0;i<this.length;i++){
            this.elements[i].checked= !this.elements[i].checked;
          }
        },
all:function(){
      for(i=0;i<this.length;i++){
        this.elements[i].checked = true;
      }
    },
unAll:function(){
        for(i=0;i<this.length;i++){
          this.elements[i].checked = false;
        }
      },
toggle:function(obj){
         this[obj.checked ? 'all' : 'unAll']();
       },
del:function(id,act){
      if(!id){
        id = [];
        for(i=0;i<this.length;i++){
          this.elements[i].checked && id.push(this.elements[i].value);
        }
        id = id.join(',');

      }
      if( confirm( "是否放入回收站") ){
      	if(!id){ alert('请选择放入回收站的内容');return false;}
        $.post( '__URL__/remove/',{id:id,act:act},function(text ){

        		window.location.reload();
            });
      }
    }

}
var c = null;
    </script>
  </head>
  <body>
    <div id="container">
      <div class="tab">
                       <ul>
                           <li> <a  href="__URL__/index/">全局设置</a></li><li><a href="__URL__/manage/" class="on">批量管理</a></li><li><a href="__URL__/recycle/">回收站管理</a></li>
                        </ul>
      </div>
      <table class="tableborder" width="100%">
        <tbody>
          <tr class="top">
            <td class="border"></td>
          </tr>
           <tr>
            <th class="header">&nbsp;</th>
          </tr>
          <tr>

            <td class="tab">
              <ul>
                <li><a href="__URL__/manage/type/group" >群组管理</a></li>
                <li><a href="__URL__/manage/type/file" >文件管理</a></li>
                <li><a href="__URL__/manage/type/topic">帖子管理</a></li>
                <li><a href="__URL__/manage/type/post" class="on">帖子回复管理</a></li>
                <li><a href="__URL__/manage/type/album">相册管理</a></li>
                <li><a href="__URL__/manage/type/photo" >图片管理</a></li>
              </ul>
            </td>
          </tr>
          <tr class="bottom">
            <td class="border" colspan="5">&nbsp;</td>
          </tr>
        </tbody>
      </table>

      <form action = "__URL__/manage" method="post">
        <table class="tableborder" width="100%">
          <tbody>
            <tr class="top">
              <td class="border" colspan="2"></td>
            </tr>
            <tr>
              <th class="header" colspan="2">查询</th>
            </tr>
            <tr class="label">
              <th>说明</th>
              <th>条件</th>
            </tr>

            <tr class="cell">
              <td class="altbg1">
                <b>查询类别:</b>
                <br/>
                <span class="smalltxt">类别（群，帖子，相册，文件）</span>
              </td>
              <td class="altbg2">
              	帖子回复
              </td>
            </tr>


            <tr class="cell">
              <td class="altbg1">
                <b>用户名:</b>
                <br/>
                <span class="smalltxt">根据用户名查询</span>
              </td>
              <td class="altbg2"><input name="name" class="txt" value="{$name}"/></td>
            </tr>

            <tr class="cell">
              <td class="altbg1">
                <b>用户Id</b>
                <br/>
                <span class="smalltxt">根据用户id</span>
              </td>
              <td class="altbg2"><input name="uid" class="txt" value="{$uid}"/></td>
            </tr>

            <tr class="cell">
              <td class="altbg1">
                <b>内容</b>
                <br/>
                <span class="smalltxt">根据回复内容,支持模糊查询。</span>
              </td>
              <td class="altbg2"><input name="title" class="txt" value="{$title}"/></td>
            </tr>

            <tr class="cell">
              <td class="altbg1">
                <b>结果排序</b>
                <br/>
              </td>
              <td class="altbg2">
                <select name="field">
                  <option value = "ctime" selected>时间排序</option>
                  <option value = "id">发布id排序</option>

                </select>
                <select name="asc">
                  <option value = "desc" selected>降序</option>
                  <option value = "asc" >升序</option>
                </select>
                <select name="limit">
                  <option value = "10" selected>每页显示10条</option>
                  <option value = "20">每页显示20条</option>
                  <option value = "30">每页显示30条</option>
                  <option value = "100">每页显示100条</option>
                </select>
              </td>
            </tr>
            <tr>
              <td class="footer" colspan="2">
              	<input type="hidden" name="type" value="post" />
                <input type="submit" class="submit" value="提交" />
              </td>
            </tr>
          </tbody>
        </table>
      </form>
      <table class="tableborder" width="100%">
        <tbody>
          <tr class="top">
            <td class="border" colspan="6"></td>
          </tr>
          <tr>
            <th class="header" colspan="6">标题</th>
          </tr>
          <tr class="label">
            <th><input type="checkbox" class="checkbox" onclick="c.toggle(this)" />删除</th>
            <th>编号</th>
            <th>回帖</th>
            <th>内容</th>
            <th>作者</th>

            <th>时间</th>

          </tr>
         	<volist name="postData['data']" id="post" key="key">
            <tr class="cell altbg1" id="post['id']">
              <td><input type="checkbox" class="checkbox" name="id[]" value="{$post['id']}" /></td>
              <td>{$key}</td>
              <td>{$post.tid|gettopic='title'}</td>
              <td>{$post.content|ubb|stripslashes|stripslashes}</td>

               <td>{$post.uid|getUserName}</td>
              <td>{$post.ctime|friendlyDate}</td>

            </tr>
          </volist>
          <tr>
            <td class="footer" colspan="7">{$postData['html']}</td>
          </tr>
          <tr>
            <td class="footer" colspan="6">
              <button type="button" onclick="c.all()">全选</button>
              <button type="button" onclick="c.unAll()">全不选</button>
              <button type="button" onclick="c.reverse()">反选</button>
              <button type="button" onclick="c.del('','post')">删除</button>
            </td>
          </tr>
          <tr class="bottom">
            <td class="border" colspan="6">&nbsp;</td>
          </tr>
        </tbody>
      </table>
    </div>
    <script type="text/javascript">
      c = new ctrl('id[]');
    </script>
  </body>
</html>
